<include file="Public:header" />
    <div class="wrap_left">
        <div class="rbox5">
            <div class="rbox5_top"></div>
            <div class="rbox5_center">
                <notempty name="list">
                <volist name="list" id="vo">
                    <div class="left">
                    	<img class="avatar" src="http://www.gravatar.com/avatar/{$vo.adder_email}?d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Faafaa838988511ab9d5942afddc615a2.png?s=44&s=44&r=g"/>
                    </div>
                    <div class="right">
                    	<div class="line"><span style="float:right">IP: {$vo.ip}  |  发表时间：{$vo.add_time|date='Y-m-d H:i:s',###}</span><a href="{$vo.url}">{$vo.adder_name}</a> 说:</div>
                    	<div class="line" style="background:#eaeaea" title="{$vo.content}">{$vo.content|msubstr=0,50}</div>
                    </div>
                    <notempty name="vo.reply">
                    <volist name="vo.reply" id="reply_vo">
						<div class="line" style="color:#F00; border:1px dashed #D9D9D9"> {$reply_vo.adder_id|getUserName} 回复：{$reply_vo.content}</div>
					</volist>
					</notempty>
                </volist>
                <else/>
                	没有可显示的留言!
                </notempty>
                <div class="page">{$page}</div>
            </div>
            <div class="rbox5_bottom"></div>            
        </div><!--留言列表-->
        
        <div class="rbox5">
            <div class="rbox5_top"></div>
            <div class="rbox5_center">
                <div class="submsg">
                <h2>发表留言</h2>
                <div id="postTemp"></div>
                <div id="ajaxContent"></div>
                <div class="sub_form">
                        <div>
                            <table><tr><td>
                            <img src="__URL__/verify" alt="点击刷新验证码" id="verifyImg" class="code" onclick="this.src+='?' + Math.random();" />
                            </td><td>
                            <input type="text" name="verify" id="verify" class="short" maxlength="4" />
                            <label>验证码（必须）</label>
                            </td></tr></table>
                        </div>
	                    <div>
	                     	<input type="text" name="adder_name" id="adder_name" class="long" />
	                     	<label class="required">您的大名（必须）</label>
	                 	</div>
	                 	<div>
	                     	<input type="text" name="adder_email" id="adder_email" class="long" />
	                     	<label class="required">您的Email（必须）</label>
	                 	</div>
                        <div><textarea name="content" id="content"></textarea></div>
                        <div>
                            <input type="button" class="button" value="" onclick="return chksub()" />
                        </div>                            
                </div>
                <script>
                function chksub(){
                    if($("#verify").val() == ''){
                        alert('请输入验证码！');
                        $("#verify").focus();
                        return false;
                    }
                    if($("#adder_name").val() == ''){
                        alert('请输入您的大名！');
                        $("#adder_name").focus();
                        return false;
                    }
                    if($("#adder_email").val() == ''){
                        alert('请输入您的Email！');
                        $("#adder_email").focus();
                        return false;
                    }
                    if($("#content").val() == '' || $("#content").val().length>100){
                        alert('内容为空或超过100字符！');
                        $("#content").focus();
                        return false;
                    }
                    postData();
                }
				//提交留言
				function postData(){
					$("#postTemp").html('<div class="pop">正在发表，请稍等......</div>');
					$.post("__URL__/add", {"verify":$("#verify").val(),"content":$("#content").val(),"adder_name":$("#adder_name").val(),"adder_email":$("#adder_email").val()}, function(msg) {
						$("#postTemp").html(msg);
						$("#verify").val('');
						$("#content").val('');
						$("#verifyImg").attr("src",function(){this.src+='?'+Math.random();});
						$(".pop").fadeOut(3000);
					});
				}
                </script>
                </div>
           </div>
            <div class="rbox5_bottom"></div>            
        </div><!--发表留言-->
    </div>        
<include file="Public:footer" />
